<?php
    function isName($name){
        $regName="/^[a-zA-Z\s]+$/";
    	if(preg_match($regName,$name)){
    		return 1;
    	}else{
    		return 0;
    	}
    }
    function isPhone($phone){
        $regPhone="/^[0-9]{10,15}$/";
    	if(preg_match($regPhone,$phone)){
    		return 1;
    	}else{
    		return 0;
    	}
    }
    function isCMND($cmnd){
        $regCMND="/^[0-9]{9}$/";
        if(preg_match($regCMND,$cmnd)){
            return 1;
        }else{
            return 0;
        }
    }
    function isDate($value){
    	if(preg_match("/^\d{1,2}[\/-]\d{1,2}[\/-]\d{4}$/",$value)||preg_match("/^\d{4}-\d{2}-\d{2}$/",$value)){
    	   return 1;
    	}else{
    	   return 0;
    	}
    }
?>